﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MyManager.Business
{
    public class Category : IEquatable<Category>
    {

        #region "Properties"
        private string _id;

        public string Id
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _name;

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }

        private string _description;

        public string Description
        {
            get { return _description; }
            set { _description = value; }
        }


        private string _parentCategoryId;

        public string ParentCategoryId
        {
            get { return _parentCategoryId; }
            set { _parentCategoryId = value; }
        }
        

        #endregion

        public Category()
        {
            
        }


        public Category(string name, string parentCategoryId)
        {
            // TODO: Complete member initialization
            this.Name = name;
            this.ParentCategoryId = parentCategoryId;
        }

        public bool Equals(Category other)
        {
            if (this.Id == other.Id) return true;
            return false;
        }

        public override int GetHashCode()
        {
            int hasForId = this.Id == null ? 0 : this.Id.GetHashCode();
            return hasForId;
        }

        public override string ToString()
        {
            return this._name;
        }
    }
}
